<script setup>
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <el-container class="app-container">
    <el-header>
      <nav class="nav-menu">
        <div class="logo">
          <img alt="Vue logo" class="logo-image" src="@/assets/logo.svg" width="32" height="32" />
          <span class="logo-text">七鱼AI助手</span>
        </div>
        <div class="nav-links">
          <el-menu mode="horizontal" router :ellipsis="false">
            <el-menu-item index="/">
              <el-icon><House /></el-icon>
              首页
            </el-menu-item>
            <el-menu-item index="/chat">
              <el-icon><ChatDotRound /></el-icon>
              AI对话
            </el-menu-item>
            <el-menu-item index="/about">
              <el-icon><InfoFilled /></el-icon>
              关于
            </el-menu-item>
          </el-menu>
        </div>
      </nav>
    </el-header>

    <el-main>
      <RouterView />
    </el-main>

    <el-footer>
      <div class="footer-content">
        <p>&copy; 2025 七鱼AI助手. All rights reserved.</p>
      </div>
    </el-footer>
  </el-container>
</template>

<style>
/* 全局样式重置 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family:
    'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #333;
  background-color: #f5f7fa;
  overflow-x: hidden;
}

#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin: 0;
  padding: 0;
}

/* 重置链接样式 */
a {
  color: inherit;
  text-decoration: none;
}

/* 重置列表样式 */
ul,
ol {
  list-style: none;
}

/* 重置表单元素样式 */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

/* 图片自适应 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 响应式媒体 */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

.el-header {
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  width: 100%;
  z-index: 100;
}

.nav-menu {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-image {
  height: 32px;
}

.logo-text {
  font-size: 1.2em;
  font-weight: bold;
  color: #409eff;
}

.nav-links {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
}

.el-menu {
  border-bottom: none !important;
}

.el-main {
  padding: 0;
  flex-grow: 1;
  background-color: #f5f7fa;
}

.el-footer {
  background-color: #fff;
  padding: 20px;
  text-align: center;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.footer-content {
  color: #909399;
  font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .logo-text {
    display: none;
  }

  .nav-menu {
    padding: 0 10px;
  }
}
</style>
